From df150a9cb5a1a3425f8d4c638182528f4dbb681a Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Wed, 5 Oct 2005 13:32:00 +0100 Subject: [PATCH] Move setting of configuration variables to Config.mk. Allows for partial-tree builds to be invoked from a sub-directory. Allow for users to include a ".config" with additional custom settings. Signed-off-by: Michal Ostrowski --- Config.mk | 11 +++++++++++ Makefile | 12 +----------- buildconfigs/Rules.mk | 2 ++ xen/Rules.mk | 3 ++- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/Config.mk b/Config.mk index e5f53cbc16..6f104e99e3 100644 --- a/Config.mk +++ b/Config.mk @@ -20,6 +20,15 @@ STRIP = $(CROSS_COMPILE)strip OBJCOPY = $(CROSS_COMPILE)objcopy OBJDUMP = $(CROSS_COMPILE)objdump +# Default is to install to local 'dist' directory. +DISTDIR ?= $(XEN_ROOT)/dist +DESTDIR ?= $(DISTDIR)/install + +INSTALL = install +INSTALL_DIR = $(INSTALL) -d -m0755 +INSTALL_DATA = $(INSTALL) -m0644 +INSTALL_PROG = $(INSTALL) -m0755 + ifeq ($(XEN_TARGET_ARCH),x86_64) LIBDIR = lib64 else @@ -49,3 +58,5 @@ ACM_USE_SECURITY_POLICY ?= ACM_NULL_POLICY XENSTAT_XENTOP ?= y VTPM_TOOLS ?= n + +-include $(XEN_ROOT)/.config diff --git a/Makefile b/Makefile index e9e6b82019..91ee5b043a 100644 --- a/Makefile +++ b/Makefile @@ -2,23 +2,12 @@ # Grand Unified Makefile for Xen. # -# Default is to install to local 'dist' directory. -DISTDIR ?= $(CURDIR)/dist -DESTDIR ?= $(DISTDIR)/install - -INSTALL := install -INSTALL_DIR := $(INSTALL) -d -m0755 -INSTALL_DATA := $(INSTALL) -m0644 -INSTALL_PROG := $(INSTALL) -m0755 - KERNELS ?= linux-2.6-xen0 linux-2.6-xenU # linux-2.4-xen0 linux-2.4-xenU netbsd-2.0-xenU # You may use wildcards in the above e.g. KERNELS=*2.4* XKERNELS := $(foreach kernel, $(KERNELS), $(patsubst buildconfigs/mk.%,%,$(wildcard buildconfigs/mk.$(kernel))) ) -export DESTDIR - # Export target architecture overrides to Xen and Linux sub-trees. ifneq ($(XEN_TARGET_ARCH),) SUBARCH := $(subst x86_32,i386,$(XEN_TARGET_ARCH)) @@ -28,6 +17,7 @@ endif # Default target must appear before any include lines all: dist +XEN_ROOT=$(CURDIR) include Config.mk include buildconfigs/Rules.mk diff --git a/buildconfigs/Rules.mk b/buildconfigs/Rules.mk index 440a9f63d1..a75bd47b0c 100644 --- a/buildconfigs/Rules.mk +++ b/buildconfigs/Rules.mk @@ -6,6 +6,8 @@ include Config.mk DISTDIR ?= $(CURDIR)/dist DESTDIR ?= $(DISTDIR)/install +export DESTDIR + ALLKERNELS = $(patsubst buildconfigs/mk.%,%,$(wildcard buildconfigs/mk.*)) ALLSPARSETREES = $(patsubst %-xen-sparse,%,$(wildcard *-xen-sparse)) diff --git a/xen/Rules.mk b/xen/Rules.mk index 4c3cb8db4e..d57ca65e51 100644 --- a/xen/Rules.mk +++ b/xen/Rules.mk @@ -10,7 +10,8 @@ trace ?= n domu_debug ?= n crash_debug ?= n -include $(BASEDIR)/../Config.mk +XEN_ROOT=$(BASEDIR)/.. +include $(XEN_ROOT)/Config.mk # Set ARCH/SUBARCH appropriately. override COMPILE_SUBARCH := $(XEN_COMPILE_ARCH) -- 2.30.2